Video encoding apparatus and video encoding method

ABSTRACT

A video encoding apparatus provides with a generator to generate a decoded image corresponding to an image obtained by decoding an encoded image obtained by encoding an original image by a first prediction scheme, a selector to select one of the original image and the decoded image as an input image according to a flicker of an image, and an encoder to encode the input image by a second prediction scheme to generate encoded data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority fromprior Japanese Patent Application No. 2005-234672, filed Aug. 12, 2005,the entire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a video encoding apparatus and methodfor replacing an original image with an inter-encoded image andintra-encoding the inter-encoded image to reduce a flicker occurringbetween the inter-encoding and the intra-encoding.

2. Description of the Related Art

In video encoding, there are intra-encoding using intra-frame prediction(used for I picture mainly) and inter-encoding using inter-frameprediction (used for P/B picture mainly). The intra-encoding andinter-encoding differ in prediction method from each other. Therefore,the distortion due to encoding differs between the intra-encoding andinter-encoding. When images are encoded in order of, for example,I→P→P→P→P→P→P→I→P, the flicker of an image occurs on a screen in P→I. Amethod for solving this problem is already proposed in “Flickersuppression of AVC/H.264 intra-frame by adaptive quantization”,FIT2004LJ-009. This method controls an encoding parameter such that theencoding distortion of an encoded I picture is nearest to the predictiveencoding distortion of a to-be-encoded I picture. However, the abovemethod contains a problem that the flicker of an image can reduce only ascene containing a little movement. Actually, the flicker occurs due tothe scene which a screen pans or the difference between the encodingdistortions of I picture and P/B picture even if the scene containsmovement of some extent.

As described above, there is a problem that the flicker can be reducedfor only a scene containing a little movement.

The present invention is to provide a video encoding apparatus andmethod for encoding an image to be intra-encoded by inter-encoding atfirst and encoding a decoded image of the inter-encoded image byintra-encoding again, to reduce a flicker in every scene as well as ascene containing a little movement.

BRIEF SUMMARY OF THE INVENTION

An aspect of the present invention provides a video encoding apparatuscomprises: a generator to generate a decoded image corresponding to animage obtained by decoding an encoded image obtained by encoding anoriginal image by a first prediction scheme; a selector to select one ofthe original image and the decoded image as an input image according toa flicker of an image; and an encoder to encode the input image by asecond prediction scheme to generate encoded data.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is a block diagram of a video encoding apparatus related to firstand second embodiments of the present invention.

FIG. 2 is a flow chart for explaining operation the video encodingapparatus related to the first embodiment of the present invention.

FIG. 3 is a flow chart for explaining operation of the video encodingapparatus related to the second embodiment of the present invention.

FIG. 4 is a block diagram of a video encoding apparatus related to athird embodiment of the present invention.

FIG. 5 is a flow chart for explaining operation of the video encodingapparatus related to the third embodiment of the present invention.

FIGS. 6A and 6B are diagrams indicating a factor causing a flicker in aB picture.

DETAILED DESCRIPTION OF THE INVENTION

There will be explained an embodiment of the present inventionhereinafter.

First Embodiment

FIG. 1 is a block diagram of a video encoding apparatus related to thefirst embodiment of the present invention.

According to the video encoding apparatus of the first embodiment, apredictive image generator 101 generates a predictive image from aninput image. The output of the predictive image generator 101 isconnected to a transformer (orthogonal transformer) 102 through asubtracter 111. This transformer 102 transforms a residual error signalbetween the input image and the predictive image from the subtracter 111into a coefficient (for example, DCT coefficient, DCT coefficient ofinteger precision or a coefficient to be provided by discrete Hadamardtransformation). The output of the transformer 102 is connected to aquantizer 103 for quantizing the coefficient. The output of thequantizer 103 is connected to an entropy encoder 104. The entropyencoder 104 entropy-encodes the quantized coefficient and information(for example, motion vector and block shape) needed for generating thepredictive image.

The output of the quantizer 103 is connected to a dequantizer 105 whichdequantizes the quantized coefficient. The output of the dequantizer 105is connected an inverse transformer 106 for subjecting the dequantizedcoefficient to inverse-transformation (inverse discrete cosinetransformation (IDCT)). The output of the inverse transformer 106 isconnected to a frame buffer 107 through an adder 112. The frame buffer107 stores a decoded image provided by adding the inverse-transformedsignal of the inverse transformer 106 and the predictive image outputfrom the predictive picture generator 101.

The output of the frame buffer 107 is connected to a flicker reductioncontroller 108 and an input image replacing unit 109. The flickerreduction controller 108 determines whether the flicker should bereduced based on the residual error signal from the subtracter and thequantized signal of the quantizer 103, and outputs a control signalaccording to a determination result to an input image replacing unit109. The input image replacing unit 109 replaces the input image with adecoded image stored in the frame buffer 107 according to a controlsignal of the flicker reduction controller 108.

The flicker reduction controller 108 controls the predictive picturegenerator 101, the frame buffer 107, the quantizer 103 and the controlrate controller 110 as well as the input image replacing unit 109. Therate controller 110 receives the number of encoded bits generated by theentropy encoder 104, calculates a quantization scale to control a bitrate, and sets it to the quantizer 103.

There will now be described the operation of the video encodingapparatus related to the first embodiment in conjunction with a flowchart of FIG. 2.

The flicker reduction controller 108 determines whether the flickershould be reduced (S101). In this time, for example, the predictiveimage generator 101 calculates a motion vector between the input imageand the reference image, and the flicker reduction controller 108receives the motion vector information and calculates the size of themotion vector.

The flicker reduction controller 108 determines the flicker when itdetects at least one of the following conditions.

-   -   The motion vector is smaller than a threshold,    -   The quantization scale calculated by the rate controller 110 is        larger than a threshold.    -   The variance value is larger than a threshold, the variance        value being obtained by calculating variance of the input image        input from the input image replacing unit 109 with the flicker        reduction controller 108.

The flicker reduction controller 108 receives a residual error signalbetween an input image signal and a predictive image signal producedwith the predictive image generator 101 to calculate an absolute valuesum of the predictive image signals, a square sum thereof, variancethereof or an average thereof. When the average is smaller than athreshold, the flicker reduction controller 108 determines to reduce theflicker. When the reduction of the flicker is determined, the processadvances to a process flow for provisionally encoding the input imagesignal (S102). When it is determined that the flicker is not reduced,the process advances to a process flow for encoding the input imagesignal (S106).

When the provisional encoding is selected, the flicker reductioncontroller 108 calculates the first quantization scale and sets it tothe quantizer 103 (S102). This first quantization scale uses thefollowing average of the quantization scales:

the average of the quantization scales obtained when the quantizer 103quantizes the image before N images in displaying order or before Nimages in encoding order, and stored and averaged in the flickercontroller 108,

the average of the quantization scales obtained when the quantizer 103quantizes the image currently encoded, and stored and averaged in theflicker controller 108, or

-   -   the average of the quantization scales obtained when the        quantizer 103 quantizes N images (I/P pictures) nearest to the        display time or encoding time and becoming the reference images        and stored and averaged in the flicker controller 108.

The input image is inter-encoded (S103). In this case, a predictiveimage is generated from the input image and some reference images by thepredictive image generator 101. A residual error signal between theinput image and the predictive image is transformed into a coefficientwith the transformer 102. The transformed coefficient is quantized withthe quantizer 103 using the first quantization scale.

The quantized coefficient is dequantized with the dequantizer 105. Thedequantized coefficient is inverse-transformed with theinverse-transformer 106. A decoded image signal is produced by addingthe predictive image signal output from the predictive image generator101 and the inverse-transformed signal and stored in the frame buffer107 (S104). The input image replacing unit 109 receives the input imagesignal with the decoded image (S105).

Thereafter, the process shifts to steps S106 to S108 for encoding theinput image signal. In this case, the flicker reduction controller 108calculates a second quantization scale used for actual encoding, andsets it to the quantizer 103. This second quantization scale uses thefollowing value, i.e., a value calculated with the rate controller 110,a value obtained by multiplying the first quantization scale calculatedwith the flicker reduction controller 108 by a ratio of less than orequal to 100%, or a value of a maximum quantization scale by which theencoding distortion is reduced less than a threshold. In other words,the input image signal is quantized with the quantizer 103, thequantized coefficient is dequantized with the dequantizer 105, and thedequantized coefficient is inverse-transformed with the inversetransformer 106. A decoded image signal is produced by adding thepredictive image signal output from the predictive image generator 101and the inverse-transformed signal with the adder 112. The decoded imageis stored in the frame buffer 107. The flicker reduction controller 108calculates the encoding distortion based on the decoded image of theframe buffer 107 and the input image signal from the input imagereplacing unit 109. The flicker reduction controller 108 calculates themaximum quantization scale by which the encoding distortion is reducedless than the threshold. In this case, the second quantization scale ismade less than the first quantization scale.

The encoding distortion is obtained by the sum of differential signalsbetween the original image and the object image to be compared, theabsolute value sum, the square sum, an average, variance,${SNR}\left( {10 \times {\log_{10}\begin{pmatrix}{{variance}\quad{of}\quad{original}\quad{image}} \\{{variance}\quad{of}\quad{error}\quad{signal}}\end{pmatrix}}{or}{{PSNR}\left( {10 \times {\log_{10}\begin{pmatrix}{255 \times 255} \\{{variance}\quad{of}\quad{error}\quad{signal}}\end{pmatrix}}} \right.}} \right.$

The predictive image generator 101 generates a predictive image from theinput image. The transformer 102 transforms the residual error signalbetween the input image and the predictive image into a coefficient. Thecoefficient is quantized with the quantizer 103 using the secondquantization scale. The input image signal is intra-encoded based on thequantized coefficient (S107).

The entropy encoder (104) receives the intra-encoded image informationfrom the quantizer 103 and the predictive image generator 101, andentropy-encode it to output a bit stream (S108). The process of theflicker reduction controller 108 is done in units of macroblock, inunits of video packet, in units of slice or in units of picture.

Second Embodiment

A video encoding apparatus related to the second embodiment of thepresent invention will be described referring to FIGS. 1 and 3. FIG. 3is a flow chart for explaining the operation of the video encodingapparatus related to the second embodiment of the present invention.

In FIG. 3, at first the flicker reduction controller 108 calculates afirst quantization scale and sets it to the quantizer 103 (S201). Thisfirst quantization scale uses the following value, i.e., an average ofthe quantization scales obtained when the quantizer 103 quantizes theimage before N images in displaying order or before N images in encodingorder, and stored and averaged in the flicker controller 108, an averageof the quantization scales obtained when the quantizer 103 quantizes theimage currently encoded, and stored and averaged in the flickercontroller 108, an average of the quantization scales obtained when thequantizer 103 quantizes N images (I/P pictures) nearest to the displaytime or encoding time and becoming the reference images, and stored andaveraged in the flicker controller 108, or a value calculated with therate controller 110.

The predictive image generator 101 generates a predictive image from theinput image, and the transformer 102 transforms a residual error signalbetween the input image and the predictive image into a coefficient. Thequantizer 103 quantizes the coefficient using the first quantizationscale to inter-encode the input image (S202).

The dequantizer 105 dequantizes the quantized coefficient. Thedequantized coefficient is inverse-transformed with the inversetransformer 106. A decode image signal is generated by adding theinverse-transformed signal and the predictive image output from thepredictive image generator 101 and stored in the frame buffer 107(S203).

The flicker reduction controller 108 determines whether the flickershould be reduced (S204). The flicker reduction controller 108determines flicker reduction when any one of the following conditions,for example, is satisfied.

(A) When the size of a motion vector between the input image and thereference image is smaller than a threshold. This “motion vector” may becalculated with the predictive image generator 101. Further, the “sizeof the motion vector” may be calculated with the flicker reductioncontroller 108.

(B) When the quantization scale calculated with the rate controller 110is larger than a threshold.

(C) When variance of the input image is larger than a threshold. The“variance of the input image” may be calculated with the flickerreduction controller 108 which receives the input image from the inputimage replacing unit 109.

(D) When the absolute value sum of residual error signals between theinput image and the predictive image, the square sum, variance oraverage is smaller than a threshold. This “predictive image” may be madewith the predictive image generator 101. The “absolute value sum”,“square sum”, “variance” or “average” may be calculated with the flickerreduction controller 108.

(E) When the encoding distortion is smaller than a threshold. Theencoding distortion is calculated by the flicker reduction controller108 based on the decoded image and the input image received from theframe buffer 107 and the input image replacing unit 109.

The encoding distortion is obtained by the sum of differential signalsbetween the original image and the object image to be compared, theabsolute value sum, the square sum, an average, variance,${SNR}\left( {10 \times {\log_{10}\begin{pmatrix}{{variance}\quad{of}\quad{original}\quad{image}} \\{{variance}\quad{of}\quad{error}\quad{signal}}\end{pmatrix}}{or}{{PSNR}\left( {10 \times {\log_{10}\begin{pmatrix}{255 \times 255} \\{{variance}\quad{of}\quad{error}\quad{signal}}\end{pmatrix}}} \right.}} \right.$

When the flicker reduction controller 108 determines reduction of theflicker, the process advances to step S205 for replacing the inputimage. When the flicker reduction controller 108 determinesnon-reduction of the flicker, the process shifts to steps S206 to S208for encoding the input image.

When the image is replaced, the input image replacing unit 109 reads outthe decoded image from the frame buffer 107 and replaces the input imagewith the decoded image (S205). The process advances to step S206 forencoding the input image.

The flicker reduction controller 108 calculates the second quantizationscale used for actual encoding and sets it to the quantizer 103 (S206).This second quantization scale is set to the following value, i.e., avalue calculated with the rate controller 110, a value obtained bymultiplying the first quantization scale calculated with the flickerreduction controller 108 by a ratio of less than or equal to 100%, or avalue of a maximum quantization scale by which the encoding distortionreduces less than a threshold. The coefficient quantized with thequantizer 103 is dequantized with the dequantizer 105 and thedequantized coefficient is inverse-transformed with theinverse-transformer 106 to obtain an inverse transformed signal. Adecoded image is produced by adding the inverse-transformed signal andthe predictive image output from the predictive image generator 101, andstored in the frame buffer 107.

The flicker reduction controller 108 receives the decoded image of theframe buffer 107 and the input image from the input image replacing unit109 to calculate encoding distortion, and calculates a maximumquantization scale by which the encoding distortion is reduced less thana threshold. However, the second quantization scale is made less thanthe first quantization scale. The process of the flicker reductioncontroller 108 is done in units of macroblock, in units of video packet,in units of slice or in units of picture.

The predictive image generator 101 generates a predictive image from theinput image. The residual error signal between the input image and thepredictive image is transformed into a coefficient by the transformer102. The coefficient is quantized with the quantizer 103 using thesecond quantization scale. As a result, the input image is intra-encoded(S207). The entropy encoder 104 receives the intra-encoded informationfrom the quantizer 103 and predictive image generator 101 toentropy-encode it, and outputs a bit stream (S208).

The second embodiment of the present invention carries out provisionalencoding indispensably, so that quantity of operation increases incomparison with the first embodiment. However, since information used bythe flicker reduction controller 108 to determine whether a flickershould be reduced increases by provisional encoding, determinationprecision can be improved.

Third Embodiment

A video encoding apparatus related to the third embodiment of thepresent invention is described in conjunction with FIGS. 4 and 5hereinafter. In the third embodiment, like reference numerals are usedto designate like structural elements corresponding to those like inFIG. 1 and any further explanation is omitted for brevity's sake.

The video encoding apparatus of FIG. 4 differs from FIG. 1 in the pointthat the flicker controller 208 controls the entropy encoder 204. FIG. 5is a flow chart for explaining the operation of the video encodingapparatus of the third embodiment.

The input image is introduced to a process flow (S308 to S309) forencoding ordinarily the input image and a process flow (S301 to S306)for encoding provisionally the input image. Both of the process flowsmay be executed in parallel or in serial. At first, the process flow forprovisionally encoding the image will be described hereinafter.

The flicker reduction controller 208 calculates the first quantizationscale and sets it to the quantizer 103 (S301). This first quantizationscale is set to the following value, i.e., an average of thequantization scales obtained when the quantizer 103 quantizes the imagebefore N images in displaying order or before N images in encodingorder, and stored and averaged in the flicker reduction controller 208,an average of the quantization scales obtained when the quantizer 103quantizes the image currently encoded, and stored and averaged in theflicker reduction controller 208, an average of the quantization scalesobtained when the quantizer 103 quantizes N images (I/P pictures)nearest to the display time or encoding time and becoming the referenceimages and stored and averaged in the flicker reduction controller 208,or a value calculated with the rate controller 110.

The predictive image generator 101 generates a predictive image from theinput image, and the transformer 102 transforms a residual error signalbetween the input image and the predictive image into a coefficient. Thecoefficient is quantized with the quantizer 103 using the firstquantization scale. As a result, the input image is inter-encoded(S302).

The quantized coefficient is dequantized with the dequantizer 105. Thedequantized coefficient is inverse-transformed with theinverse-transformer 106. A decoded image signal is produced by addingthe predictive image signal output from the predictive image generator101 and the inverse-transformed signal and stored in the frame buffer207 (S303).

When the image is replaced, the input image replacing unit 109 reads outthe decoded image from the frame buffer 107 and replaces the input imagewith the decoded image (S304). The flicker reduction controller 208calculates the second quantization scale used for encoding really andsets it to the quantizer 103 (S305). This second quantization scale isset to the following value, i.e., a value calculated with the ratecontroller 110, a value obtained by multiplying the first quantizationscale calculated with the flicker reduction controller 108 by a ratio ofless than or equal to 100%, or a maximum value by which the encodingdistortion reduces less than a threshold.

The coefficient quantized with the quantizer 103 is dequantized with thedequantizer 105 and the dequantized coefficient is inverse-transformedwith the inverse-transformer 106 to obtain an inverse transformedsignal. A decoded image signal is produced by adding the predictiveimage signal output from the predictive image generator 101 and theinverse-transformed signal, and stored in the frame buffer 107.

The flicker reduction controller 208 calculates the encoding distortionbased on the decoded image of the frame buffer 107 and the input imagesignal from the input image replacing unit 109. Further, the flickerreduction controller 208 calculates a maximum quantization scale bywhich the encoding distortion is reduced less than the threshold.However, the second quantization scale is made less than the firstquantization scale.

The encoding distortion is obtained by the sum of differential signalsbetween the original image and the object image to be compared, theabsolute value sum, the square sum, an average, variance,${SNR}\left( {10 \times {\log_{10}\begin{pmatrix}{{variance}\quad{of}\quad{original}\quad{image}} \\{{variance}\quad{of}\quad{error}\quad{signal}}\end{pmatrix}}{or}{{PSNR}\left( {10 \times {\log_{10}\begin{pmatrix}{255 \times 255} \\{{variance}\quad{of}\quad{error}\quad{signal}}\end{pmatrix}}} \right.}} \right.$

The predictive image generator 101 generates a predictive image from theinput image. The transformer 102 transforms the residual error signalbetween the input image and the predictive image into a coefficient. Thecoefficient is quantized with the quantizer 103 using the secondquantization scale. As a result, the input image signal is intra-encoded(S306). The encoded image is stored in the flicker reduction controller208 as a provisional encoded image A.

The process flow for encoding ordinarily the input image is explainedhereinafter. The third quantization scale is calculated and set to thequantizer 103 (S308). This third quantization scale is calculated withthe rate controller 110, for example, and set to the quantizer 103.

The predictive image generator 101 generates a predictive image from theinput image, and the transformer 102 transforms a residual error signalbetween the input image and the predictive image into a coefficient. Thequantizer 103 inter-encodes the input image by quantizing thecoefficient according to the third quantization scale (S309). Theencoded image is stored in the flicker reduction controller 208 as anordinarily encoded image B.

The flicker reduction controller 208 determines whether the flickershould to be reduced (S307). In this time, the predictive imagegenerator 101 calculates a motion vector between the input image and thereference image. The flicker reduction controller 208 determines toreduce the flicker on one or more the following conditions:

-   -   when the size of motion vector calculated from received motion        vector information is less than a threshold;    -   when the quantization scale calculated with the rate controller        110 is more than a threshold;    -   when the first quantization scale calculated with the flicker        reduction controller 208 is more than a threshold;    -   when a value of variance of the input image which is calculated        with the flicker reduction controller 208 received the input        image from the input image replacing unit 109 is more than a        threshold,    -   when an absolute value sum, a square sum, a variance or an        average is less than a threshold, each parameter being        calculated with the flicker reduction controller 208 based on a        residual error signal between the input image and the predictive        image generated with the predictive image generator 101;    -   when encoding distortion is less than a threshold, the encoding        distortion being calculated with the flicker reduction        controller 208 to which the decoded image A of the provisional        encoded image A and the decoded image B of the ordinarily        encoded image B are input together with the input image from the        input image replacing unit 209, the decoded images A and B each        being produced by adding the inverse-transformed signal from the        inverse-transformer 106 and the predictive image from the        predictive image generator 101; or    -   when each encoding distortion difference is more than a        threshold.

When it is determined that the flicker is reduced, the flicker reductioncontroller 208 sends the provisional encoded image A to the entropyencoder 104. When it is determined that the flicker is not reduced, theflicker reduction controller 208 sends the ordinarily encoded image B tothe entropy encoder 104. The entropy encoder 104 receives intra-encodedinformation from the flicker reduction controller 208 andentropy-encodes it to output a bit stream (S310). The process of theflicker reduction controller 208 is done in units of macroblock, inunits of video packet, in units of slice or in units of picture.

Since the third embodiment executes both of a serial encoding process(S301 to S306) for reducing the flicker and an ordinal encoding process(S308, S309), the quantity of operation increases in comparison with thefirst or second embodiment of the present invention. However,information used with the flicker reduction controller 208 fordetermining whether the flicker should be reduced is determined based onthe ordinary encoding result and the encoding result of reducing theflicker, so that the determination precision can be improved.

As thus described, according to the video encoding apparatus related tothe first to third embodiments, at first an image to be encoded byintra-encoding (I picture) is encoded by inter-encoding (P/B picture),and then the decoded image of the inter-encoded image is intra-encoded.As a result, it is possible to reduce the flicker in every scene.

In the above embodiments, the process for reducing the flicker in theintra-encoding is explained. However, the present invention is notlimited to reducing the flicker in the intra-encoding. There is a casethat the flicker occurs between inter-encoding and inter-encoding, too.In an example shown in FIG. 6A, P3 picture is predicted from B1 and B2pictures and I0 picture. Therefore, the flicker does not occur. Incontrast, since B4, B5 pictures are predicted from the I6 picturecausing the flicker, the flicker occurs. In such a case, theintra-encoding process in the embodiment is changed to theinter-encoding process, and the flicker reduction controller 108 makesthe predictive image generator 101 change a prediction structure at thetime of executing provisional encoding by inter-encoding. As a result,the problem of the flicker can be solved.

In the case of FIG. 6A, B4 picture is predicted from P3 picture, streamediting is enabled between both pictures. In the case of FIG. 6B, B4 andB5 pictures are predicted by I6 and P3 pictures, the flicker does notoccur. Accordingly, in this case, it is not necessary to make thepredictive image generator 101 change a prediction structure. However,in the example of FIG. 6B, the stream editing cannot be carried outbetween P3 picture and B4 pictures.

This video encoding apparatus can be realized by using general-purposecomputer equipment as basic hardware. In other words, the predictiveimage generation, transformation/inverse-transformation,quantization/dequantization, entropy encoding, frame buffering, inputimage replacing and determination of flicker reduction can be executedby program installed in the computer equipment. In this time, the videoencoding apparatus may realized by installing the program in thecomputer equipment beforehand, and by installing the program stored in astorage medium such as a compact disk-read only memory or distributedvia a network in the computer equipment appropriately.

Further, it can be realized by using appropriately a memory and a harddisk built in or externally mounted on the computer equipment or astorage medium such as CD-R, CD-RW, DVD-RAM, DVD-R.

According to the present invention, since intra-encoding (I picture) hasproperty similar to the image encoded as inter-encoding (P/B picture)first, it is possible to reduce the flicker in every scene.

Additional advantages and modifications will readily occur to thoseskilled in the art. Therefore, the invention in its broader aspects isnot limited to the specific details and representative embodiments shownand described herein. Accordingly, various modifications may be madewithout departing from the spirit or scope of the general inventiveconcept as defined by the appended claims and their equivalents.

1. A video encoding apparatus comprises: a generator to generate adecoded image corresponding to an image obtained by decoding an encodedimage obtained by encoding an original image by a first predictionscheme; a selector to select one of the original image and the decodedimage as an input image according to a flicker condition; and an encoderto encode the input image by a second prediction scheme to generateencoded data.
 2. The video encoding apparatus according to claim 1,wherein the encoder includes a quantizer to quantize the original imagewith a first quantization scale and the decoded image with a secondquantization scale, the second quantization scale being less than thefirst quantization scale.
 3. The video encoding apparatus according toclaim 2, wherein the first quantization scale corresponds to a value bywhich number of encoded bits is nearest to a target value.
 4. The videoencoding apparatus according to claim 2, wherein the second quantizationscale corresponds to a value obtained by multiplying a given ratio bythe first quantization scale.
 5. The video encoding apparatus accordingto claim 2, wherein the second quantization scale corresponds to amaximum value by which quantization distortion becomes less than athreshold.
 6. The video encoding apparatus according to claim 2, whereinthe first quantization scale corresponds to an average of quantizationscales used in encoding N frames in encoding order or display order. 7.The video encoding apparatus according to claim 2, wherein the firstquantization scale corresponds to an average of quantization scales inan image currently encoded.
 8. The video encoding apparatus according toclaim 2, wherein the first quantization scale corresponds to an averageof quantization scales in M frames nearest to an image currently encodedin encoding order or display order and coming to a reference.
 9. Thevideo encoding apparatus according to claim 1, wherein the firstprediction scheme includes an inter-frame prediction.
 10. The videoencoding apparatus according to claim 1, wherein the second predictionscheme includes an intra-frame prediction.
 11. The video encodingapparatus according to claim 1, wherein when the original picture imagecorresponds to an image to be encoded as a random accessible image, itsatisfies the condition for reducing the flicker.
 12. The video encodingapparatus according to claim 1, wherein when a current image and afuture image in display order are decodable without an image which ismore past than the current image in display order, the condition forreducing the flicker is satisfied.
 13. The video encoding apparatusaccording to claim 1, wherein when size of a motion vector between theoriginal image and the decoded image used as a reference image is lessthan a threshold, the condition for reducing the flicker is satisfied.14. The video encoding apparatus according to claim 1, which furthercomprises a determination unit configured to determine whether acondition for reducing the flicker is satisfied, by using one of anencoding parameter used in the encoder, the original image and thedecoded image, and wherein the selector selects the original image asthe input image when the determination unit determines to fail tosatisfy the condition for reducing the flicker, and selects the decodedimage as the input image when the determination unit determines tosatisfy the condition.
 15. The video encoding apparatus according toclaim 14, wherein when size of the first quantization scale or size ofthe second quantization scale is more than a threshold, the conditionfor reducing the flicker is satisfied.
 16. The video encoding apparatusaccording to claim 14, wherein when variance of the original image orthe decoded image is more than a threshold, the condition for reducingthe flicker is satisfied.
 17. The video encoding apparatus according toclaim 14, wherein when one of an absolute value sum of residual errorsignals due to motion compensation between the decoded image and thereference image, a square sum, a variance or an average is less than athreshold, the condition for reducing the flicker is satisfied.
 18. Thevideo encoding apparatus according to claim 14, wherein when encodingdistortion of an image corresponding to an image obtained by decoding anencoded image obtained by encoding the decoded image by the secondprediction scheme is less than a threshold, the condition for reducingthe flicker is satisfied.
 19. The video encoding apparatus according toclaim 14, wherein one of an average of a difference between firstencoding distortion and second encoding distortion, an average ofabsolute value, variance, variance of absolute value, an absolute valuesum and a square sum is more than a threshold, the condition issatisfied, the first encoding distortion being encoding distortion of animage corresponding to an image obtained by decoding an encoded imageobtained by encoding the original image by the second prediction schemeand the second encoding distortion being encoding distortion of an imagecorresponding to an image obtained by decoding an encoded image obtainedby encoding the decoded image by the second prediction scheme.
 20. Avideo encoding apparatus comprising: an encoder to generate a comparisonimage corresponding to one of a decoded image corresponding to an imageobtained by decoding an encoded image obtained by encoding an originalimage by a first prediction scheme, a first encoded image obtained byencoding the original image by a second prediction scheme, a secondencoded image generated by encoding the decoded image by the secondprediction scheme, and an image obtained by decoding the second encodedimage; a comparator to compare the decoded image with the comparisonimage; and an output unit configured to output the second encoded imagewhen a comparison result of the comparator satisfies a condition forreducing a flicker and output the first encoded image when thecomparison result fails to satisfy the condition.
 21. A video encodingmethod comprising: generating a comparison image corresponding to adecoded image corresponding to an image obtained by decoding an encodedimage obtained by encoding an original image by a first predictionscheme, a first encoded image obtained by encoding the original image bya second prediction scheme, a second encoded image obtained by encodingthe decoded image by the second prediction scheme, and an image obtainedby decoding the second encoded image; comparing the decoded image withthe comparison image; and outputting the second encoded data when acomparison result of the comparing satisfies a condition for reducingthe flicker and the first encoded data when the comparison result failsto satisfy the condition.
 22. A video encoding program stored in acomputer readable medium comprising: means for instructing a computer togenerate a comparison image corresponding to one of a decoded imagecorresponding to an image obtained by decoding an encoded image obtainedby encoding an original image by a first prediction scheme, a firstencoded image obtained by encoding the original image by a secondprediction system, a second encoded image obtained by encoding thedecoded image by the second prediction scheme, and an image obtained bydecoding the second encoded data; means for instructing the computer tocompare the decoded image with the comparison image; and means forinstructing the computer to output the second encoded data when acomparison result satisfies a condition for reducing the flicker andoutput the first encoded data when the comparison result fails tosatisfy the condition.